package cn.zwxky.android.user.Scope;

import android.content.Context;
import android.view.View;

import com.zgscwjm.lsfbbasetemplate.Event.LsfbEvent;
import com.zgscwjm.lsfbbasetemplate.adapter.CommonRecycAdapter;
import com.zgscwjm.lsfbbasetemplate.adapter.ViewHolderRecyc;

import java.util.List;

import cn.zwxky.android.user.R;

/**
 * Created by Administrator on 2017/3/27 0027.
 */

public class ScopeAdapter extends CommonRecycAdapter<ScopeBean.ListBean> {

    public ScopeAdapter(Context context, List<ScopeBean.ListBean> list, int layoutId) {
        super(context, list, layoutId);
    }

    @Override
    public void convert(ViewHolderRecyc holder, final ScopeBean.ListBean model) {
               holder.setText(R.id.item_search_text_name,model.getName());
               holder.setText(R.id.item_search_text_countext,model.getBewrite());

        holder.setOnclick(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ScopeClickEvent even = new ScopeClickEvent();
                even.setData(model);
                LsfbEvent.getInstantiation().post(even);
            }
        });

    }
}
